package com.bibi.hanshunping.chapter06;

public class ArrayExercise01 {
    public static void main(String[] args) {
        char[] chars = new char[26];
        char A = 'A';
        for (int i = 0; i < chars.length; i++) {
            chars[i] = (char)('A' + i);
        }

        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }

        int[] nums = {4, -1, 9, 10, 23};
        int max = 0; int index = 0;
        for (int i = 0; i < nums.length; i++) {
            if (i == 0) max = nums[i]; // 防止数组内都是负值
            if (max < nums[i]) {
                max = nums[i];
                index = i;
            }
        }
        System.out.println("最大值为：" + index + "=" + max);
    }
}
